<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
	<title>选择商会</title>
	<link rel="stylesheet" type="text/css" href="../app/css/aui-win.css" />
	<style type="text/css">
		.search_button{
			position: absolute;
			right: 8%;
			top:10px;
			width: 32px;
			height: 32px;
			background:url(../app/image/home/busess/search.png) no-repeat center center ; 
		}
		.search{
			width: 100%;
			height: 50px;
			position: relative;
			background:#f4f4f4;
		}
		.search input{
			width: 85%;
			height: 31px;
			float: left;
			margin:10px 0 0 5%;
			border: 1px solid #ccc;
			padding-left: 5%;
			border-radius: 15px;
		}
		.city{
			height: 50px;
			background: white;
		}
		.city li{
			float: left;
			width:14.28457%;
			height: 50px;
			text-align: center;
			line-height: 50px;
			font-size: 14px
		}
		.city li:hover{
			color:#00abfd;
		}
		.content_group{
			width: 100%;
		}
		.content_group li{
			float: left;
			width: 20%;
			margin-left: 4%;
			margin-top:10px;
			position: relative;
		}
		.content_group li img{
			width: 100%;
		}
		.content_group li p{
			width: 100%;
			height: 50px;
			text-align: center;
			font-size: 0.5em;

		}
	</style>
</head>
<body>
<div class="div_loding_img">
		数据加载中
	</div>
	<header class="aui-bar aui-bar-nav aui-bar-yunzo" id="aui-header">
		<a class="aui-btn aui-bar-yunzo aui-pull-left" id="back" onclick="back_go()"> <span class="aui-iconfont aui-icon-left"></span></a>
		<div class="aui-title" id="title">
			选择商会
		</div>
	</header>
	<div class="margin_div"></div>
	<ul class="city">
		<li class="quan">全国</li>
		<li class="city1">上海</li>
		<li class="city2">北京</li>
		<li class="city3">深圳</li>
		<li class="city4">成都</li>
		<li class="city5">广州</li>
		<a href="../app/html/second_frame/choice_city.html"><li style="color:#00abfd;">编辑</li></a>
	</ul>
	<div class="search">
		<input type="text" placeholder="请输入商会名称" id="sousuo">
		<div class="search_button" onclick="keyword()"></div>
	</div>
	<ul class="content_group"></ul>
	<script src="../app/script/jquery-1.10.2.min.js"></script>
	<script src="../app/script/common.js"></script>
	<script type="text/javascript">
	sTart_Stop();
		function choice_city(url){
			window.location =url;
		}
		var city1=$(".city1").html()
		var city2=$(".city2").html()
		var city3=$(".city3").html()
		var city4=$(".city4").html()
		var city5=$(".city5").html()
		var localData =  window.localStorage;
		if(localStorage.city1==undefined&&localStorage.city2==undefined&&localStorage.city3==undefined&&localStorage.city4==undefined&&localStorage.city5==undefined){
        	localData.setItem("city1",city1);
        	localData.setItem("city2",city2);
        	localData.setItem("city3",city3);
        	localData.setItem("city4",city4);
        	localData.setItem("city5",city5);
    	}
    	else{
    		$(".city1").html(localStorage.city1)
    		$(".city2").html(localStorage.city2)
    		$(".city3").html(localStorage.city3)
    		$(".city4").html(localStorage.city4)
    		$(".city5").html(localStorage.city5)
    	}
		var curCount=0;
    	var pagesize=50;
		function jiazai(){
	    	var str="";
	       	var src;
	    	
	    	var post =basedata('groupinfo')+"&pagesize="+pagesize+"&curcount="+curCount;
	    	ajaxcocRequest('../api/group/getallgroupinfolist', 'post', post, function(msg){
				if(msg.code ==100){
					//n2为图片名称
					//n1图片logo地址
					//n0商会信息ID
					if(msg.data.length!=0){
						for(var i=0;i<msg.data.length;i++){
							if(msg.data[i].n1==""||msg.data[i].n1==" "){
								src='../app/image/bgg.png';						}
							else{
								src=msg.data[i].n1;
							}
							str+='<a href="groupinfo.html?gid='+msg.data[i].n0+'"><li><img src="'+src+'"><p>'+msg.data[i].n2+'</p></li></a>'
						}
						
						$(".content_group").html(str);
					}
					else{
						$(".content_group").html("<div style='width:20%;margin:40px 0 0 40%;'><img src='../app/image/gantan.png' style='width:100%;'></div><p style='width:100%;text-align:center;margin-top:30px;color:#999;font-size:18px;'>没有任何商会！</p>")
					}
					$(".content_group li img").height($(".content_group li").width())
				}
				else{
					$("body").append('<div class="wuwang"><img src="../app/image/iconfont-wangluo.png"><p>网络拥堵，信息塞车</p></div>')
				}
			});
		}
		jiazai();
		function city_group(city,keyword){
			var sttr="";
			var bodyParam = {"mid":$mids,"groupid":$groupidss,"did":initdata.get('yunzofindgroup'),"pagesize":pagesize,"curcount":curCount,"likename":keyword,"areaname":city};
			ajaxCoCRequest('../api/group/queryareaandlikeallgroupinfolist', 'post', bodyParam, function(msg){
				if(msg.code ==100){
					if(msg.data.length!=0){
						for(var i=0;i<msg.data.length;i++){
						if(msg.data[i].n1==""||msg.data[i].n1==" "){
							src='../app/image/bgg.png';
						}
						else{
							src=msg.data[i].n1;
						}
						sttr+='<a href="groupinfo.html?gid='+msg.data[i].n0+'"><li><img src="'+src+'"><p>'+msg.data[i].n2+'</p></li></a>'
					}
					$(".content_group").html("");
					$(".content_group").html(sttr);
					$(".content_group li img").height($(".content_group li").width())
					}
					else{
						$(".content_group").html("<div style='width:20%;margin:40px 0 0 40%;'><img src='../app/image/gantan.png' style='width:100%;'></div><p style='width:100%;text-align:center;margin-top:30px;color:#999;font-size:18px;'>没有任何商会！</p>")
					}
				}
				else{
					$("body").append('<div class="wuwang"><img src="../app/image/iconfont-wangluo.png"><p>网络拥堵，信息塞车</p></div>')
				}
			})
		}
		function keyword(){
			var a;
			var b=$("#sousuo").val();
			city_group(a,b);
		}
		$("li").click(function(){
			var a=$(this).html();
			if(a=="编辑"){
				
			}
			else{
				var b;
				if(a=="全国"){
					jiazai();
				}
				else{
					city_group(a,b);
				}
			}
		})
	</script>
</body>
</html>